package cn.ecnu;


import cn.ecnu.constant.ResponseStatus;
import cn.ecnu.entity.Car;
import cn.ecnu.entity.Employee;
import cn.ecnu.entity.User;
import cn.ecnu.mapper.UserMapper;
import com.github.javafaker.Faker;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;

import javax.annotation.Resource;
import java.util.Locale;

@SpringBootTest
public class MainApplication {

    @Resource
    UserMapper userMapper;

    @Test
    void createForUser() {
        Faker faker = new Faker(new Locale("zh-CN"));
        User user = new User();
        for (int i = 0; i < 20; i++) {
            user.setId(ResponseStatus.uuidGenerator());
            user.setUsername(faker.name().name());
            user.setPhone(faker.phoneNumber().phoneNumber());
            user.setPassword(faker.harryPotter().book());
            user.setRole(0);
            userMapper.insertUser(user);
        }
    }



    @Test
    void test() {
        Faker faker = new Faker(new Locale("zh-CN"));
        System.out.println(faker.address().cityName().concat("市"));

    }

}
